package com.hoperun.product.util;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.util.DisplayMetrics;

import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.LanguageUtils;
import com.blankj.utilcode.util.SPStaticUtils;
import com.blankj.utilcode.util.Utils;
import com.hoperun.product.common.Setting;

import java.util.Locale;

public class LanguageUtil {

    /**
     * 切换语言
     */
    public static void changeLanguage() {
        if (SPStaticUtils.getString(Setting.SP_LANGUAGE,"zh").equals("zh")){
            LanguageUtils.applyLanguage(new Locale("vi","VN"), "");
            SPStaticUtils.put(Setting.SP_LANGUAGE,"vi");
        }else{
            LanguageUtils.applyLanguage(Locale.SIMPLIFIED_CHINESE, "");
            SPStaticUtils.put(Setting.SP_LANGUAGE,"zh");
        }
    }


    /**
     * 返回语言标识
     * @return
     */
    public static  String  getLanguageStr(){
        return   SPStaticUtils.getString(Setting.SP_LANGUAGE,"zh");
    }




}
